package br.com.financeiro.controllers;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Component;

import br.com.financeiro.dominio.Usuario;
import br.com.financeiro.services.CrudService;

@Component
@Scope("session")
public class UsuarioMBean extends CrudMBean<Usuario> {

	public UsuarioMBean() {
		obj = new Usuario();
	}
	
	@Override
	protected String getDir() {
		return "/pages/usuario";
	}
	
	@Autowired
	protected void setService(CrudService<Usuario> service) {
		super.setService(service);
	}
	
	@Override
	@Secured("ROLE_ADMIN")
	public String novo() {
		return super.novo();
	}
	
}
